use super::hitls_crypt_type::{HITLS_CipherParameters, HITLS_SignAlgo};
use super::hitls_type::{HITLS_Config, HITLS_Ctx, HITLS_Session};
pub const HITLS_SESSION_ID_CTX_MAX_SIZE: u32 = 32;
pub const HITLS_SESSION_ID_MAX_SIZE: u32 = 32;
pub const HITLS_TICKET_KEY_RET_NEED_ALERT: i32 = -1;
pub const HITLS_TICKET_KEY_RET_FAIL: u32 = 0;
pub const HITLS_TICKET_KEY_RET_SUCCESS: u32 = 1;
pub const HITLS_TICKET_KEY_RET_SUCCESS_RENEW: u32 = 2;
unsafe extern "C" {
    pub fn HITLS_CFG_SetSessionTicketSupport(config: *mut HITLS_Config, support: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetSessionTicketSupport(
        config: *const HITLS_Config,
        isSupport: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetTicketNums(config: *mut HITLS_Config, ticketNums: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetTicketNums(config: *mut HITLS_Config) -> u32;
}
unsafe extern "C" {
    pub fn HITLS_SetTicketNums(ctx: *mut HITLS_Ctx, ticketNums: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_GetTicketNums(ctx: *mut HITLS_Ctx) -> u32;
}
pub type HITLS_NewSessionCb = ::std::option::Option<
    unsafe extern "C" fn(ctx: *mut HITLS_Ctx, session: *mut HITLS_Session) -> i32,
>;
pub type HITLS_SessionRemoveCb = ::std::option::Option<
    unsafe extern "C" fn(config: *mut HITLS_Config, sess: *mut HITLS_Session),
>;
pub type HITLS_SessionGetCb = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut HITLS_Ctx,
        data: *const u8,
        len: i32,
        copy: *mut i32,
    ) -> *mut HITLS_Session,
>;
pub type HITLS_SessionTicketExtProcessCb = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut HITLS_Ctx,
        data: *const u8,
        len: i32,
        arg: *mut ::std::os::raw::c_void,
    ) -> i32,
>;
unsafe extern "C" {
    pub fn HITLS_CFG_SetNewSessionCb(
        config: *mut HITLS_Config,
        newSessionCb: HITLS_NewSessionCb,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetSessionGetCb(
        config: *mut HITLS_Config,
        sessionGetCb: HITLS_SessionGetCb,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetSessionRemoveCb(
        config: *mut HITLS_Config,
        sessionRemoveCb: HITLS_SessionRemoveCb,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SetSessionTicketExtProcessCb(
        ctx: *mut HITLS_Ctx,
        sessionTicketExtCb: HITLS_SessionTicketExtProcessCb,
        arg: *mut ::std::os::raw::c_void,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SetSessionTicketExtData(ctx: *mut HITLS_Ctx, data: *mut u8, dataSize: u32) -> i32;
}
pub type HITLS_TicketKeyCb = ::std::option::Option<
    unsafe extern "C" fn(
        keyName: *mut u8,
        keyNameSize: u32,
        cipher: *mut HITLS_CipherParameters,
        isEncrypt: u8,
    ) -> i32,
>;
unsafe extern "C" {
    pub fn HITLS_CFG_SetTicketKeyCallback(
        config: *mut HITLS_Config,
        callback: HITLS_TicketKeyCb,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetSessionTicketKey(
        config: *const HITLS_Config,
        key: *mut u8,
        keySize: u32,
        outSize: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetSessionTicketKey(
        config: *mut HITLS_Config,
        key: *const u8,
        keySize: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetSessionIdCtx(
        config: *mut HITLS_Config,
        sessionIdCtx: *const u8,
        len: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetSessionCacheMode(config: *mut HITLS_Config, mode: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetSessionCacheMode(config: *mut HITLS_Config, mode: *mut u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetSessionCacheSize(config: *mut HITLS_Config, size: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetSessionCacheSize(config: *mut HITLS_Config, size: *mut u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetSessionTimeout(config: *mut HITLS_Config, timeout: u64) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetSessionTimeout(config: *const HITLS_Config, timeout: *mut u64) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_IsSessionReused(ctx: *mut HITLS_Ctx, isReused: *mut bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SetSessionIdCtx(ctx: *mut HITLS_Ctx, sessionIdCtx: *const u8, len: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_GetSessionTicketKey(
        ctx: *const HITLS_Ctx,
        key: *mut u8,
        keySize: u32,
        outSize: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SetSessionTicketKey(ctx: *mut HITLS_Ctx, key: *const u8, keySize: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SetSession(ctx: *mut HITLS_Ctx, session: *mut HITLS_Session) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_GetSession(ctx: *const HITLS_Ctx) -> *mut HITLS_Session;
}
unsafe extern "C" {
    pub fn HITLS_GetDupSession(ctx: *mut HITLS_Ctx) -> *mut HITLS_Session;
}
unsafe extern "C" {
    pub fn HITLS_GetPeerSignatureType(ctx: *const HITLS_Ctx, sigType: *mut HITLS_SignAlgo) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_New() -> *mut HITLS_Session;
}
unsafe extern "C" {
    pub fn HITLS_SESS_Dup(sess: *mut HITLS_Session) -> *mut HITLS_Session;
}
unsafe extern "C" {
    pub fn HITLS_SESS_Free(sess: *mut HITLS_Session);
}
unsafe extern "C" {
    pub fn HITLS_SESS_SetMasterKey(
        sess: *mut HITLS_Session,
        masterKey: *const u8,
        masterKeySize: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_GetMasterKeyLen(sess: *const HITLS_Session) -> u32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_GetMasterKey(
        sess: *const HITLS_Session,
        masterKey: *mut u8,
        masterKeySize: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_GetProtocolVersion(sess: *const HITLS_Session, version: *mut u16) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_SetProtocolVersion(sess: *mut HITLS_Session, version: u16) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_SetCipherSuite(sess: *mut HITLS_Session, cipherSuite: u16) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_GetCipherSuite(sess: *const HITLS_Session, cipherSuite: *mut u16) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_SetSessionIdCtx(
        sess: *mut HITLS_Session,
        sessionIdCtx: *mut u8,
        sessionIdCtxSize: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_GetSessionIdCtx(
        sess: *const HITLS_Session,
        sessionIdCtx: *mut u8,
        sessionIdCtxSize: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_SetSessionId(
        sess: *mut HITLS_Session,
        sessionId: *mut u8,
        sessionIdSize: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_GetSessionId(
        sess: *const HITLS_Session,
        sessionId: *mut u8,
        sessionIdSize: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_SetHaveExtMasterSecret(
        sess: *mut HITLS_Session,
        haveExtMasterSecret: u8,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_GetHaveExtMasterSecret(
        sess: *mut HITLS_Session,
        haveExtMasterSecret: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_SetTimeout(sess: *mut HITLS_Session, timeout: u64) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_SESS_GetTimeout(sess: *mut HITLS_Session) -> u64;
}
unsafe extern "C" {
    pub fn HITLS_SESS_IsResumable(sess: *const HITLS_Session) -> bool;
}
unsafe extern "C" {
    pub fn HITLS_SESS_HasTicket(sess: *const HITLS_Session) -> bool;
}
unsafe extern "C" {
    pub fn HITLS_SESS_GetUserData(sess: *const HITLS_Session) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    pub fn HITLS_SESS_SetUserData(
        sess: *mut HITLS_Session,
        userData: *mut ::std::os::raw::c_void,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_ClearTimeoutSession(config: *mut HITLS_Config, nowTime: u64) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_RemoveSession(config: *mut HITLS_Config, sess: *mut HITLS_Session) -> i32;
}
